package com.pocket.insight.base.sql.dataset;

import com.pocket.insight.base.mql.TypedVal;
import com.pocket.insight.controller.dto.DatasetResultDto;
import com.pocket.insight.controller.dto.SqlParam;
import com.pocket.insight.entity.Dataset;

import java.util.List;

/**
 * 描述：
 *
 * @author shuize
 * @create 2024/12/4
 */
public interface DatasetProxy {

    // 创建数据集代理
    static DatasetProxy create(Dataset dataset) {
        return new DatasetProxyImpl(dataset);
    }

    DatasetResource getDatasetResource();

    DatasetResultDto fetchDatasetData(SqlParam sqlParam);

    DatasetResultDto fetchFieldsData(List<Dataset.Field> paramList, SqlParam paramSqlParam);

    TypedVal fieldsToQuery(List<Dataset.Field> fields, SqlParam sqlParam, Boolean forCastType);

}
